% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/boxplots_ratios.R
\name{boxplots_ratios}
\alias{boxplots_ratios}
\title{boxplots of demographics across sites as ratios to US means}
\usage{
boxplots_ratios(
  x,
  selected_dvar_colname = varlist2names("names_d")[1],
  selected_dvar_nicename = selected_dvar_colname,
  towhat_nicename = "US average",
  wheretext = "Near"
)
}
\arguments{
\item{x}{data.frame that is the output of ejscreen analysis, for example:

\if{html}{\out{<div class="sourceCode">}}\preformatted{x <- ejscreenit(testpoints_5)$table
x <- testoutput_ejscreenapi_plus_5
}\if{html}{\out{</div>}}}

\item{selected_dvar_colname}{default is "Demog.Index"}

\item{selected_dvar_nicename}{default is "Demog.Index"}

\item{towhat_nicename}{default is "US average"}

\item{wheretext}{Use in plot subtitle. Default is "Near" but could be "Within 5km of" for example.
If it is a number, n, it will set wheretext to "Within n miles of"}
}
\value{
same format as output of \code{\link[ggplot2:ggplot]{ggplot2::ggplot()}}
}
\description{
boxplots show range of scores here vs range in US overall
}
\details{
See \code{\link[=plot_boxplot_pctiles]{plot_boxplot_pctiles()}} now espec. for percentiles.

This function originally was used for ejscreenit() output, and
was just a quick interim solution that could be replaced.

To communicate whether this is skewed to the right
(more high scores than might expect) also could say that
X\% OF SITES OR PEOPLE have scores in top Y\% of US range, >= 100-Y percentile.
e.g., 20\% of these sites have scores at least in the top 5\% of US scores
(which is more/less than one might expect
\itemize{
\item leaving aside statistical significance
ie whether this could be by chance if sites were randomly picked
from US block groups or people's bg scores)
}
}
\examples{
  # x <- testoutput_ejscreenit_50$table # or
  x <- testoutput_ejscreenapi_plus_5
  myradius <- x$radius.miles[1]
  boxplots_ratios(calc_ratios_to_avg(x)$ratios_d, wheretext = myradius)
  #boxplots_ratios(calc_ratios_to_avg(x)$ratios_e, wheretext = myradius)

}
